<#import '/ftlLibrary/properteisVariable.ftl' as pv/>
<div class="row" style="margin: 0 1px;">
	<input type="hidden"  name="memberPackageId" class="memberPackageId" value="${memberPackageId}"/>
	<p class="text-right" style="padding: 20px 0;margin: 0;">会员王华华，可选课课时数：22课时</p>
	<#list listMap as data>
		<div class="panel-group" id="accordion">
			<div class="panel panel-info">
				<div class="panel-heading">
					<h4 class="panel-title" data-toggle="collapse" data-parent="#accordion"
						href="#collapse${data_index+1}" style="cursor: pointer;">
						<a>${data.courseName} / ${data.courseName} /  ${data.courseName}</a>
						<a class="float-right">收起</a>
					</h4>
				</div>
				<div id="collapse${data_index+1}" class="panel-collapse collapse in">
					<div class="panel-body">
						<p class="text-center">课程日期：${data.startDate}-${data.endDate} ${data.startTime}-${data.endTime}，${data.weekDay} 课程节数：${data.expendClassHour}节 单节消耗课时数：${data.pitchNumber}</p>
						<form class="bs-example bs-example-form" role="form">
							<div class="row" id="checkbox${data_index+1}" class="checkboxBox">
								<div class="btn-toolbar" role="toolbar" style="margin: 10px;">
									<#list data["lessonsList"] as cl>
										<div class="btn-group">
											<button type="button" class="btn btn-default">
												<input  type="checkbox" name="clId" class="chk" value="${cl.id}"style="position: static;opacity: 1;margin: 0;width: 12px;height: 12px;margin: 3px 0;">
											</button>
											<button type="button" class="btn btn-default ">${cl_index+1}</button>
											<button type="button" class="btn btn-default ">${cl.classTime} </button>
											<button type="button" class="btn btn-default "><@dictionary groupCode="weekDay" dictionaryCode="${data.weekDay}" ;weekDay>${weekDay.value }</@dictionary> </button>
										</div>
									</#list>
								</div>
							</div>
							<div class="row">
								<div class="btn-toolbar" role="toolbar" style="margin: 10px;">
									<div class="btn-group">
										<input type="checkbox" class="checkboxs${data_index+1}" style="position: static;opacity: 1;margin: 0;width: 12px;height: 12px;margin: 3px 0;"> 全选
										<span>可选课时数不足，请购买或激活其他课时包</span>
									</div>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</#list>

	<div class="col-sm-12 text-align-center">
		<label style="margin-bottom: 15px;">
			<button style="border-radius: 0px;border: none;background: #ffab00 !important;"
					class="btn btn-warning shiny search margin-right-10" onclick="topClass()">完成并同步课程表
			</button>
		</label>
	</div>
</div>
	<script>
    $(".selectpicker").select2();

    /**
     * 班级停课
     * @param that
     */
    function topClass() {

        var allCheckVlaues = new Array();
        $("[name='clId']:checked").map(function (index, chk) {
            var value = chk.value;
            allCheckVlaues.push(value);
        });
        var allCheckVlauesStr = allCheckVlaues.join(",");
        alert(allCheckVlauesStr);
        ajaxRequest("tssClassesLessonsController/stopClassByLessonIds.do", {
            lessonIds: allCheckVlauesStr
        }, function (result) {
            alert("停课成功");
            if (result.resCode == 200) {
                bootbox.hideAll();
            }
        }, function () {
            ajaxError("加载页面失败!")
        }, "get", "html")
    }

</script>